From: Marco Trevisan (TreviƱo) Date: Fri, 13 Sep 2019 15:59:16 +0000 (+0200) Subject: popupBaseMenuItem: Add support for Hidden Ornament X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~811^2^2~39 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=af1aabff75cc62d178e9166464fada6b47bb3299;p=gnome-shell.git popupBaseMenuItem: Add support for Hidden Ornament The menu item ornament is used to put dots or checks in menus or otherwise to define a padding for a label. However in some cases we want to create a menu item with no left (in ltr) padding. In order to do that, define a HIDDEN Ornament mode that completely hides the ornament actor. The naming here might be confusing as this should probably be called NONE, while the default mode is the invisible one, but it's too late to change it now. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/720 --- diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index e26771555..ad9b3c77c 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -15,6 +15,7 @@ var Ornament = { NONE: 0, DOT: 1, CHECK: 2, + HIDDEN: 3, }; function isPopupMenuItemVisible(child) { @@ -248,10 +249,12 @@ var PopupBaseMenuItem = GObject.registerClass({ } else if (ornament == Ornament.CHECK) { this._ornamentLabel.text = '\u2713'; this.add_accessible_state(Atk.StateType.CHECKED); - } else if (ornament == Ornament.NONE) { + } else if (ornament == Ornament.NONE || ornament == Ornament.HIDDEN) { this._ornamentLabel.text = ''; this.remove_accessible_state(Atk.StateType.CHECKED); } + + this._ornamentLabel.visible = ornament != Ornament.HIDDEN; } });